I:/Documents/developpement/projets/C/blast/blastguy_wii_2.2/src/sprite.h File Reference

Sprite manipulation routines. More...

#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
#include <SDL/sdl.h>
#include "image.h"
#include "sdl_utils.h"

Include dependency graph for sprite.h:

This graph shows which files directly or indirectly include this file:


Data Structures

struct  t_sprite
 A sprite is an image, to be displayed on the screen, at a given coord. It also got a bounding box for collisions stuff... More...
struct  t_animation
struct  t_anim_sprite
 A sprite with animations, it got a pointer to a simple sprite, and informations needeed to anmate it. the sprite'simage is the charset, and width and height are divded by the number of animations. Remember that t_anim_sprite must be manipulated with anim_sprite functions. More...

Functions

void anim_sprite_draw (anim_sprite *p_sprite, SDL_Surface *destination)
 Draw an animated sprite.
void anim_sprite_update_frame (anim_sprite *p_sprite)
 Update the frame of the animated sprite if it is time (frame_delay).
int anim_sprite_get_height (anim_sprite *p_sprite)
 Get the anim_sprite height.
int anim_sprite_get_width (anim_sprite *p_sprite)
 Get the anim_sprite width.

Detailed Description

Sprite manipulation routines.

Author:
DREVET Olivier
Date:
September and October 2008
Note:
ANSI c90 compliance. Published under the GPL 3 license (see license.txt for more info)

Function Documentation

int anim_sprite_get_height ( anim_sprite p_sprite  ) 

Get the anim_sprite height.

Note:
charset height / frame_nb_y

int anim_sprite_get_width ( anim_sprite p_sprite  ) 

Get the anim_sprite width.

Note:
charset width / frame_nb_x

void anim_sprite_update_frame ( anim_sprite p_sprite  ) 

Update the frame of the animated sprite if it is time (frame_delay).

Note:
Increment frame_current, or put it at 0 if more than frame_nb (see t_animation) Put frame_trigger to 0.


Generated on Tue Nov 4 21:07:22 2008 for Blastgu by  doxygen 1.5.4